Replay time: 56:53 SQL to identify Candidate tablespaces that are very large compared to other tablespaces: # Please modify this as your needs demand. with temp1 as (select TBSP_NAME as tbsp_name, sum(TBSP_USED_SIZE_KB/1024) as tbsp_size from sysibmadm.tbsp_utilization group by TBSP_NAME) , temp2 as (select t1.tbspace as tbsp_name, count(*) as tbl_cnt from syscat.tables t1, syscat.tablespaces t2 where t1.type='T‘ and t1.tbspace=t2.tbspace and t1.tbspace <> 'DWEDEFAULTCONTROL' group by t1.tbspace having count(*) > 1) select char(temp1.TBSP_NAME,20), temp1.tbsp_size, temp2.tbl_cnt from temp1, temp2 where temp1.tbsp_name=temp2.tbsp_name order by temp1.tbsp_size desc fetch first 100 rows only with ur ; Replay time: 57:47 SQL1 -- Identify tablespaces with > 1 GB HWM reduction opportunity: SELECT CHAR(TBSP_NAME,18) AS TBSP_NAME, SUM((TBSP_PAGE_TOP-TBSP_USED_PAGES)*TBSP_PAGE_SIZE/1024/1024/1024) as TO_BE_REDUCED_SPACE_GB FROM SYSIBMADM.TBSP_UTILIZATION GROUP BY TBSP_NAME HAVING SUM((TBSP_PAGE_TOP-TBSP_USED_PAGES)*TBSP_PAGE_SIZE/1024/1024/1024) > 1 ORDER BY 2 DESC FETCH FIRST 100 ROWS ONLY WITH UR; SQL 2 – Identify how much space (MB) would be reduced from each container: (if you are curious to find out how much HWM in MB would be reduced by DB2) SELECT char(TBSP_UTIL.TBSP_NAME,20) AS TABLESPACE, char(CONTAINER_NAME,50) as CONTAINER, TBSP_UTIL.DBPARTITIONNUM as PARTITION, TBSP_PAGE_TOP as HWM, (TBSP_FREE_SIZE_KB/1024) as FREE_MB, (TBSP_PAGE_TOP-TBSP_USED_PAGES)*TBSP_PAGE_SIZE/1024/1024 as HWM_REDUCTION_OPPORTUNITY_MB from SYSIBMADM.TBSP_UTILIZATION TBSP_UTIL, SYSIBMADM.CONTAINER_UTILIZATION CONT_UTIL WHERE TBSP_UTIL.TBSP_NAME=CONT_UTIL.TBSP_NAME AND TBSP_UTIL.DBPARTITIONNUM=CONT_UTIL.DBPARTITIONNUM AND TBSP_UTIL.TBSP_NAME=‘$TBSP’ order by TBSP_UTIL.DBPARTITIONNUM with ur; Replay time: 58:20 Information to help fix skew at table level: URL: http://www.ibm.com/developerworks/data/library/techarticle/dm-1005partitioningkeys/ Example from IBM Info Center: $db2 "set serveroutput on" $ db2 "CALL estimate_existing_data_skew('TPCD', 'SUPPLIER', 25)" CALL estimate_existing_data_skew('TPCD', 'SUPPLIER', 25) Return Status = 0 DATA SKEW ESTIMATION REPORT FOR TABLE: TPCD.SUPPLIER Accuracy is based on 25% sample of data ------------------------------------------------------------------------ TPCD.SUPPLIER Estimated total number of records in the table: : 19,994,960 Estimated average number of records per partition : 2,499,368 Row count at partition 1 : 1,599,376 (Skew: -36.00%) Row count at partition 2 : 2,402,472 (Skew: 3.87%) Row count at partition 3 : 4,001,716 (Skew: 60.10%) Row count at partition 4 : 2,394,468 (Skew: -4.19%) Row count at partition 5 : 1,600,028 (Skew: -35.98%) Row count at partition 6 : 1,599,296 (Skew: -36.01%) Row count at partition 7 : 2,397,116 (Skew: -4.09%) Row count at partition 8 : 4,000,488 (Skew: 60.05%) Number of partitions: 8 (1, 2, 3, 4, 5, 6, 7, 8) ------------------------------------------------------------------------ Total execution time: 20 seconds